using System.Data;
using PCSComPayroll.DS;
using PCSComUtils.Common;


namespace PCSComPayroll.BO
{
	public class AdditionSalaryBO
	{
		public AdditionSalaryBO()
		{
			//
			// TODO: Add constructor logic here
			//
		}
		#region IObjectBO Members

		public void UpdateDataSet(System.Data.DataSet dstData)
		{
			// TODO:  Add AdditionSalaryBO.UpdateDataSet implementation
		}

		public void Update(object pObjectDetail)
		{
			// TODO:  Add AdditionSalaryBO.Update implementation
		}
		//[AutoComplete(true)]
		public void Update(object pObjectDetail, DataSet pdstData)
		{
			PAY_AdditionSalaryMasterVO voMaster = (PAY_AdditionSalaryMasterVO)pObjectDetail;
			PAY_AdditionSalaryMasterDS dsMaster = new PAY_AdditionSalaryMasterDS();
			dsMaster.Update(voMaster);
			PAY_AdditionSalaryDetailDS dsDetail = new PAY_AdditionSalaryDetailDS();
			dsDetail.UpdateDataSet(pdstData);
		}

		public void Delete(object pObjectVO)
		{
			// TODO:  Add AdditionSalaryBO.Delete implementation
		}
		//[AutoComplete(true)]
		public void Delete(int pintMasterID)
		{
			PAY_AdditionSalaryDetailDS dsDetail = new PAY_AdditionSalaryDetailDS();
			dsDetail.Delete(pintMasterID);
			PAY_AdditionSalaryMasterDS dsMaster = new PAY_AdditionSalaryMasterDS();
			dsMaster.Delete(pintMasterID);
		}

		public void Add(object pObjectDetail)
		{
			// TODO:  Add AdditionSalaryBO.Add implementation
		}
		//[AutoComplete(true)]
		public int AddAndReturnID(object pObjectDetail, DataSet pdstData)
		{
			PAY_AdditionSalaryMasterVO voMaster = (PAY_AdditionSalaryMasterVO)pObjectDetail;
			PAY_AdditionSalaryMasterDS dsMaster = new PAY_AdditionSalaryMasterDS();
			voMaster.AdditionSalaryMasterID = dsMaster.AddAndReturnID(voMaster);
			foreach (DataRow drowData in pdstData.Tables[0].Rows)
			{
				if (drowData.RowState != DataRowState.Deleted)
					drowData[PAY_AdditionSalaryDetailTable.ADDITIONSALARYMASTERID_FLD] = voMaster.AdditionSalaryMasterID;
			}
			PAY_AdditionSalaryDetailDS dsDetail = new PAY_AdditionSalaryDetailDS();
			dsDetail.UpdateDataSet(pdstData);
			return voMaster.AdditionSalaryMasterID;
		}

		//[AutoComplete(true)]
		public object GetObjectVO(int pintID, string VOclass)
		{
			PAY_AdditionSalaryMasterDS dsMaster = new PAY_AdditionSalaryMasterDS();
			return dsMaster.GetObjectVO(pintID);
		}

		#endregion

		//[AutoComplete(true)]
		public DataSet List(int pintMasterID)
		{
			PAY_AdditionSalaryDetailDS dsDetail = new PAY_AdditionSalaryDetailDS();
			return dsDetail.List(pintMasterID);
		}
		//[AutoComplete(true)]
		public DataTable GetEstimateData(int pintSaleOrderDetailID)
		{
			PAY_EstimateDetailDS dsEstimateDetail = new PAY_EstimateDetailDS();
			return dsEstimateDetail.GetEstimateDetailBySale(pintSaleOrderDetailID);
		}
	}
}
